package Demo.model;

import java.io.Serializable;
import java.util.Objects;

public class Student implements Serializable {

    private String username;
    private String pasword;
    private int age;

    public Student() {

    }

    public Student(String username, String pasword, int age) {
        this.username = username;
        this.pasword = pasword;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasword() {
        return pasword;
    }

    public void setPasword(String pasword) {
        this.pasword = pasword;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "username='" + username + '\'' +
                ", pasword='" + pasword + '\'' +
                ", age=" + age +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Student)) return false;
        Student student = (Student) o;
        return age == student.age &&
                Objects.equals(username, student.username) &&
                Objects.equals(pasword, student.pasword);
    }

    @Override
    public int hashCode() {
        return Objects.hash(username, pasword, age);
    }
}
